package com.project.psc.config;

import com.project.psc.util.GradeInterceptor;
import com.project.psc.util.TokenInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class MVCConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //定义客户端什么样的访问URL，需要经过指定的拦截器
        registry.addInterceptor(new TokenInterceptor())
                .excludePathPatterns("/supplier/login","/supplier/register","/supply/updateStatus");

        registry.addInterceptor(new GradeInterceptor())
                .excludePathPatterns("/supplier/**","/supply/updateStatus");
    }


}
